<script>
	export default {
		onLaunch: function() {
			this.isLogin();
		},
		methods:{
			isLogin(){ //检查是否登陆
				var user_info = uni.getStorageSync("user_info");
				if(user_info == null || user_info == ""){
					uni.reLaunch({
						url:"/pages/login/login"
					})
				}else{
					var role = user_info.authtype;
					// 判断角色跳转
					if(role == "教师"){//教师
						uni.reLaunch({
							url:"/pages/index/index_t/index_t"
						})
					}else{//学生
						uni.reLaunch({
							url:"/pages/index/index"
						})	
					}
					
					
				}
			},
		},
		onShow: function() {
		},
		onHide: function() {
		}
	}
</script>

<style>
	/*每个页面公共css */
	@import "colorui/icon.css";
	@import "colorui/main.css";
</style>
